package com.ericsson.smart.constant;

public enum HierarchyEnum {
	HIERARCHY_TIME("TBL_TIME_HIERARCHY", "HIERARCHICAL_ORDER"), HIERARCHY_GEOGRAPHY(
			"TBL_GEO_HIERARCHY", "HIERARCHICAL_ORDER"), HIERARCHY_SUBSTATION(
			"TBL_SUBSTATION_HIERARCHY", "HIERARCHICAL_ORDER");

	private String table;

	private String id;

	public String getTable() {
		return table;
	}

	public String getId() {
		return id;
	}

	HierarchyEnum(String table, String id) {
		this.table = table;
		this.id = id;
	}

	public static HierarchyEnum getHierarchyEnum(String tableName) {
		for (HierarchyEnum h : HierarchyEnum.values()) {
			if (h.getTable().equalsIgnoreCase(tableName)) {
				return h;
			}
		}
		return null;
	}
}
